var express = require("express");
var path = require("path");
var router = express.Router();
const multer = require("multer");
var videoController = require(path.join(
  process.cwd(),
  "/controller/videoController"
));
var searchController = require(path.join(
  process.cwd(),
  "/controller/searchController"
));

router.get("/", function (req, res, next) {
  res.sendResult(null, 200, "获取成功");
});

router.post(
  "/upload",
  multer({
    dest: "upload",
  }).array("file", 9),
  videoController.upload
);

router.get("/download", videoController.download);

//获取视频所有标签
router.get("/getVideoLabel", videoController.getVideoLabel);

//获取回复评论
router.get("/getreplycomment/:commentid", videoController.getReplyComment);
//获取视频的评论
router.get("/getvideocomment/:videoid", videoController.getVideoComment);
//查询视频
router.get("/getvideosearch/:key", searchController.getVideoSearch);

module.exports = router;
